let pagingData = accountData

function showTable(data) {
    $('.table_content').html('')
    $('#motaikuang').html('')
    showID() //重新渲染每个的ID值
    for (i = 0; i < data.length; i++) {
        $('#motaikuang').append(`  
        <div class="modal fade" tabindex="-1" role="dialog" id="shanchu_table${data[i].id}">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">是否要确认删除${data[i].name}的数据</h4>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary">确定</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="myModal${data[i].id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog modal-dialog-quanxian" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel">设置功能权限</h4>
                                </div>
                                <div class="modal-body">
                                <div class=" table_down clearfix">
                                    <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 A</span><span class="iconfont icon-arrow-down pull-right"></span></div>
                                        <div class="row drop_option_down drop_option_down_top">
                                    <div class="col-md-2 col-xs-2">
                                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                    </div>
                                    <div class="col-md-10 col-xs-10 clearfix">
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                                    </div>
                                </div>
                                <div class="row drop_option_down drop_option_down_center">
                                    <div class="col-md-2 col-xs-2">
                                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                    </div>
                                    <div class="col-md-10 col-xs-10 clearfix">
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    </div>
                                </div>
                                <div class="row drop_option_down drop_option_down_center">
                                    <div class="col-md-2 col-xs-2">
                                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                    </div>
                                    <div class="col-md-10 col-xs-10 clearfix">
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    </div>
                                </div>
                            </div>
                                <div class=" table_down clearfix">
                                <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 B</span><span class="iconfont icon-arrow-down pull-right"></span></div>
                                <div class="row drop_option_down drop_option_down_top">
                                <div class="col-md-2 col-xs-2">
                                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                </div>
                                <div class="col-md-10 col-xs-10 clearfix">
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                                </div>
                                </div>
                                <div class="row drop_option_down drop_option_down_center">
                                <div class="col-md-2 col-xs-2">
                                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                </div>
                                <div class="col-md-10 col-xs-10 clearfix">
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                </div>
                                </div>
                                <div class="row drop_option_down drop_option_down_center">
                                <div class="col-md-2 col-xs-2">
                                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                </div>
                                <div class="col-md-10 col-xs-10 clearfix">
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                </div>
                                </div>
                                </div> <div class=" table_down clearfix">
                                <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 C</span><span class="iconfont icon-arrow-down pull-right"></span></div>
                                <div class="row drop_option_down drop_option_down_top">
                                <div class="col-md-2 col-xs-2">
                                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                                </div>
                                <div class="col-md-10 col-xs-10 clearfix">
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                                </div>
                                </div>
                                <div class="row drop_option_down drop_option_down_center">
                            <div class="col-md-2 col-xs-2">
                                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                            </div>
                            <div class="col-md-10 col-xs-10 clearfix">
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            </div>
                        </div>
                        <div class="row drop_option_down drop_option_down_center">
                            <div class="col-md-2 col-xs-2">
                                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                            </div>
                            <div class="col-md-10 col-xs-10 clearfix">
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            </div>
                        </div>
                    </div> <div class=" table_down clearfix">
                    <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 D</span><span class="iconfont icon-arrow-down pull-right"></span></div>
                    <div class="row drop_option_down drop_option_down_top">
                        <div class="col-md-2 col-xs-2">
                            <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                        </div>
                        <div class="col-md-10 col-xs-10 clearfix">
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                        </div>
                    </div>
                    <div class="row drop_option_down drop_option_down_center">
                        <div class="col-md-2 col-xs-2">
                            <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                        </div>
                        <div class="col-md-10 col-xs-10 clearfix">
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        </div>
                    </div>
                    <div class="row drop_option_down drop_option_down_center">
                        <div class="col-md-2 col-xs-2">
                            <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                        </div>
                        <div class="col-md-10 col-xs-10 clearfix">
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                            <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        </div>
                    </div>
                </div> <div class=" table_down clearfix">
                <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 E</span><span class="iconfont icon-arrow-down pull-right"></span></div>
                <div class="row drop_option_down drop_option_down_top">
                    <div class="col-md-2 col-xs-2">
                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                    </div>
                    <div class="col-md-10 col-xs-10 clearfix">
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                    </div>
                </div>
                <div class="row drop_option_down drop_option_down_center">
                    <div class="col-md-2 col-xs-2">
                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                    </div>
                    <div class="col-md-10 col-xs-10 clearfix">
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    </div>
                </div>
                <div class="row drop_option_down drop_option_down_center">
                    <div class="col-md-2 col-xs-2">
                        <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                    </div>
                    <div class="col-md-10 col-xs-10 clearfix">
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                        <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    </div>
                </div>
            </div> <div class=" table_down clearfix">
            <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 F</span><span class="iconfont icon-arrow-down pull-right"></span></div>
            <div class="row drop_option_down drop_option_down_top">
                <div class="col-md-2 col-xs-2">
                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                </div>
                <div class="col-md-10 col-xs-10 clearfix">
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
                </div>
            </div>
            <div class="row drop_option_down drop_option_down_center">
                <div class="col-md-2 col-xs-2">
                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                </div>
                <div class="col-md-10 col-xs-10 clearfix">
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                </div>
            </div>
            <div class="row drop_option_down drop_option_down_center">
                <div class="col-md-2 col-xs-2">
                    <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
                </div>
                <div class="col-md-10 col-xs-10 clearfix">
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                    <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                </div>
            </div>
        </div> <div class=" table_down clearfix">
        <div class="drop_option"><input type="checkbox" value=""><span class="checkbox_span">一级选项 G</span><span class="iconfont icon-arrow-down pull-right"></span></div>
        <div class="row drop_option_down drop_option_down_top">
            <div class="col-md-2 col-xs-2">
                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
            </div>
            <div class="col-md-10 col-xs-10 clearfix">
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">新增</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">编辑</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">删除</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">刷新</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量编辑</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量删除</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量审核</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量刷新</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">批量强制取消</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">详情</span></div>
            </div>
        </div>
        <div class="row drop_option_down drop_option_down_center">
            <div class="col-md-2 col-xs-2">
                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
            </div>
            <div class="col-md-10 col-xs-10 clearfix">
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
            </div>
        </div>
        <div class="row drop_option_down drop_option_down_center">
            <div class="col-md-2 col-xs-2">
                <input type="checkbox" value=""><span class="checkbox_span">二级选项</span>
            </div>
            <div class="col-md-10 col-xs-10 clearfix">
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
                <div class="pull-left"><input type="checkbox" value=""><span class="checkbox_span">三级选项</span></div>
            </div>
        </div>
    </div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primaryquanxian">确定</button>
</div>
</div>
</div>
</div>
    `)
        $('.table_content').append(`
                <tr>
                    <td>
                        <input type="checkbox" value="${data[i].id}" name="check_table">
                    </td>
                    <td>${data[i].id}</td>
                    <td>${data[i].userName}</td>
                    <td>${data[i].name}</td>
                    <td>${data[i].org}</td>
                    <td>${data[i].state}</td>
                    <td><span data-toggle="modal" data-target="#myModal${data[i].id}" class="set_permission">
                    设置权限
                    </span>
                    <span class="shanchu_table" type="button" data-toggle="modal" data-target="#shanchu_table${data[i].id}">删除
                    </span><span class="bianji_table"><a href="./xinZengJueShe.html">编辑</a></span></td>
                    <td><span>查看详情</span></td>
                </tr>
                `)
    }
}

$('#motaikuang').on('click', '.drop_option', function() { //下拉样式
    console.log($(this).parent());
    if ($(this).parent().css('height') == '60px') {
        $(this).parent().css({
            height: 'auto'
        })
        $(this).parent().siblings().css({
            height: '60px'
        })
        return
    }
    $(this).parent().css({
        height: '60px'
    })
})
let per_table
$('.table_content').on('click', '.set_permission', function() { //设置权限
    per_table = $(this)
})
$('#motaikuang').on('click', '.btn-primaryquanxian', function() {
    let idNum = parseInt(del_table.parent().siblings().eq(1).text())
    del_table.parent().parent().remove()
    pagingData.splice(idNum - 1, 1)
    paging(num, pagingData, disPage)
    $('.fade').css({ display: 'none' })
    $(this).parent().parent().parent().parent().remove()
})

let del_table
$('.table_content').on('click', '.shanchu_table', function() { //删除
    del_table = $(this)
})
$('#motaikuang').on('click', '.btn-primary', function() {
    let idNum = parseInt(del_table.parent().siblings().eq(1).text())
    del_table.parent().parent().remove()
    pagingData.splice(idNum - 1, 1)
    paging(num, pagingData, disPage)
    $('.fade').css({ display: 'none' })
    $(this).parent().parent().parent().parent().remove()
})

$('.table_content').on('click', '.bianji_table', function() { //编辑
    console.log($(this));
    paging(num, pagingData, disPage)
})

let num = 1 //初始页
let lengthPage //最大页数
    // 渲染页数
let disPage = 10
$('.page_data').click(function() {
    disPage = parseInt($(this).attr('data-num'))
    paging(num, pagingData, disPage)
})

function showPage(data, disPage) {
    $('.pagination').html(`    <li class="prePage">
                        <a href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                  
                    <li class="nextPage">
                        <a href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>`) //每次渲染前刷新一下渲染的内容

    lengthPage = Math.ceil(data.length / disPage) //lengthPage是最大页数

    for (let i = 1; i <= lengthPage; i++) {
        let pageCont = $('.pagination li:last-of-type').before(`
        <li class="new_page"><a href="#">${i}</a></li>
        `)
        if (lengthPage <= 5) {
            pageCont
        } else if (lengthPage > 5) {
            if (num <= 2) {
                pageCont
                $('.new_page').eq(num + 2).children().text(`...`)
                $('.new_page').slice(num + 3, lengthPage - 1).css({
                    display: 'none'
                })
            } else if (num > 2 && num < 4) {
                $('.new_page').eq(num + 1).children().text(`...`)
                $('.new_page').slice(num + 2, lengthPage - 1).css({
                    display: 'none'
                })
            } else if (num >= 4) {
                pageCont
                if (num < lengthPage - 2) {
                    $('.new_page').eq(1).children().text(`...`)
                    $('.new_page').eq(num + 1).children().text(`...`)
                    $('.new_page').slice(num + 2, lengthPage - 1).css({
                        display: 'none'
                    })
                    $('.new_page').slice(2, num - 2).css({
                        display: 'none'
                    })
                } else if (num <= lengthPage && num > lengthPage - 2) {
                    $('.new_page').eq(1).children().text(`...`)
                    $('.new_page').slice(2, lengthPage - 3).css({
                        display: 'none'
                    })
                } else {
                    $('.new_page').eq(1).children().text(`...`)
                    $('.new_page').slice(2, num - 2).css({
                        display: 'none'
                    })
                }
            }
        }
    }
    $('.new_page').eq(num - 1).toggleClass('active')
}
showPage(pagingData, disPage)
let start //每一页的起始坐标
let checkedBoole


function paging(id, data, disPage) { // 修改每一页显示的内容
    start = (id - 1) * disPage //每一页的起始下标为页面值减1再乘5，
    let arr = data.slice(start, start + disPage)
    showTable(arr)

    $('.quanxuan').click(function() { //全选按钮
        if ($(this).prop('checked') == true) {
            $(".table_content input").prop("checked", true)
        } else {
            $(".table_content input").prop("checked", false)
        }
    })
    showPage(pagingData, disPage)
}

$('.shanchu').click(function() {
    if (confirm('是否确定删除？')) {
        $("input[name='check_table']:checked").each(function() { // 遍历选中的checkbox
            let n = $(this).parents("tr").index(); // 获取checkbox所在行的顺序
            let m = parseInt($(".table_content").find("tr:eq(" + n + ")").children().eq(1).text()) //所在行的id值
            $(".table_content").find("tr:eq(" + n + ")").remove();
            for (let i = 0; i < accountData.length; i++) {
                if (m == pagingData[i].id) {
                    pagingData.splice(i, 1)
                    i--
                    break
                }
            }
        });
        paging(num, pagingData, disPage)
        alert('删除成功')
    }
});


paging(1, pagingData, disPage)
    // 点击页数跳转到对应的页数
$('.pagination').on('click', '.new_page', function() {
        if ($(this).children().text() != '...') {
            $(this).toggleClass('active')
            num = parseInt($(this).text())
            paging($(this).text(), pagingData, disPage)
        }
    })
    // 点击上一页跳转的上一页
$('.pagination').on('click', '.prePage', function() {
        num > 1 ? num-- && paging(num, pagingData, disPage) : paging(1, pagingData, disPage)
    })
    // 点击下一页跳转的下一页
$('.pagination').on('click', '.nextPage', function() {
    num < lengthPage ? num++ && paging(num, pagingData, disPage) : paging(lengthPage, pagingData, disPage)
})